﻿using Gumini.JulaDB.DataTypes;

namespace Gumini.JulaDB.Expressions.Operators
{
    internal class NegationOperator : UnaryOperator
    {
        public NegationOperator()
            : base("not") { }
    
        public override TypedValue Evaluate(TypedValue arg)
        {
            bool value = (bool)arg.Value;
            return new TypedValue(arg.Type, !value);
        }

        public override DataType GetReturnType()
        {
            return DataType.Bool;
        }
    }
}
